<div id="wrap">
    <h1><?php echo $this->title; ?></h1>
    <div class="statisticsNav clearfix">
        <div class="school subject">
            <h1>学校</h1>
            <ul>
                <?php $photo_image_db_data = $photo_image_data; $photo_json_data = ''; ?>
                <?php if(!empty($school_array)): ?>
                <?php   foreach($school_array as $k => $sVal): if($k==0): $x_id = $sVal['school_id']; endif;  ?>
                <li><?php echo $sVal['school_name']; ?></li>

                <?php //统计学校图表数据
                    $photo_image_data['dataNum'] = $photo_image_db_data['dataNum'] = array();
                    if(!empty($photo_other_array['dx_data'])){
                        foreach($photo_other_array['dx_data'] as $oVal){
                            $photo_image_data['dataNum'][] = isset($oVal[$sVal['school_id']])?$oVal[$sVal['school_id']]:array();
                        }
                    }
                    if(!empty($photo_other_array['db_data'])){
                        foreach($photo_other_array['db_data'] as $oVal){
                            $photo_image_db_data['dataNum'][] = isset($oVal[$sVal['school_id']])?$oVal[$sVal['school_id']]:array();
                        }
                    }
                    $photo_image_data['peopleNum'] = $photo_image_db_data['peopleNum'] = isset($photo_people_num[$sVal['school_id']])?$photo_people_num[$sVal['school_id']]:0;
                    
                    $photo_json_data['dx_data'][] = $photo_image_data;
                    $photo_json_data['db_data'][] = $photo_image_db_data; ?>
                
                <?php   endforeach; ?>
                <?php endif; ?>
            </ul>

        </div>
        <p style="clear:both;"></p>
    </div>
    <div class="clearfix">
        <ul class="statisticsType_nav">
            <li class="on">二本达线</li>
            <li>达线+BC</li>
        </ul>
        <div id="statisticsChart" class="clearfix" style="z-index:1;"></div>
        <p style="clear:both;"></p>
    </div>
    <div class="clearfix pr20">
    <input type="submit" value="导出" name="submit" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 cursor fr import_list" />
    </div>
    <div id="statisticsTABLE" class="clearfix">
        <table class="fontc_666 height32" align="center" valign="middle" border="0" cellpadding="0" cellspacing="0" width="1950px">
            <thead class=" fontc_999" bgColor="#4e98bd" style="color:#fff;">
                <tr height="38">
                    <th width="150" align="center" colspan="2" rowspan="3" valign="middle" class="border_d"><span style="padding:0 5px;">分数线</span></th>
                    <?php echo $table1; ?>
                </tr>
                <tr height="38">
                    <?php echo $table2; ?>
                </tr>
            </thead>
            <tbody style="background:#fff;">

                <tr height="38">
                    <?php echo $table3; ?>
                </tr>
                <tr height="38">
                    <?php echo $table4; ?>
                </tr>
                <tr height="38">
                    <?php echo $table5; ?>
                </tr>
                <?php echo $table6; ?>
            </tbody>
        </table>
    </div>
</div>
<script>
    $(function(){
        var data_array = <?php echo json_encode($photo_json_data['dx_data']); ?>; //本二
        var data_db_array = <?php echo json_encode($photo_json_data['db_data']); ?>; //达b
        var data = data_array[0];
        YUEchart.fractionalLineChart( $("#statisticsChart"),data );

        $(".subject ul li" ).click(function(){
            $(this).addClass("on").siblings().removeClass( "on" );
            var school_i= $(this).index(),
                typeId = $( ".statisticsType_nav li.on" ).index();
            if( typeId == 0 ){
                YUEchart.fractionalLineChart( $("#statisticsChart"),data_array[school_i] );
            }else{
                YUEchart.fractionalLineChart( $("#statisticsChart"),data_db_array[school_i] );
            }
            
        });
        $( ".statisticsType_nav li" ).click(function(){
            $(this).addClass("on").siblings().removeClass( "on" );
            var typeId= $(this).index(),
                school_i = $( ".subject li.on" ).index();
            if( typeId == 0 ){
                YUEchart.fractionalLineChart( $("#statisticsChart"),data_array[school_i] );
            }else{
                YUEchart.fractionalLineChart( $("#statisticsChart"),data_db_array[school_i] );
            }
            
        });
        
        var exam_id = '<?php echo $exam_id; ?>';
        var school_id = '<?php echo $school_id; ?>';
        var ptype = '<?php echo $ptype; ?>';
        var mp = '<?php echo $mp; ?>';
        
        //导出相关数据
        $(".import_list").click(function(){
           $.get('/change_scores/default/import_list', {exam_id: exam_id,school_id: school_id,ptype:ptype,mp:mp}, function(data) {
                if(data==1){
                    $.dialog.alert('导出数据不存在');
                }else{
                    window.location.href = '<?php echo $this->createUrl('/change_scores/default/import_list'); ?>/exam_id/<?php echo $exam_id; ?>/school_id/<?php echo $school_id; ?>/ptype/<?php echo $ptype; ?>/mp/<?php echo $mp; ?>';
                }
                return false;
            });
        });
        
    });
</script>